<script type="text/javascript" src="js/class.js"></script>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<link href="images/skin.css" rel="stylesheet" type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-color: #EEF2FB;
}
-->
</style>
<style type="text/css">
<!--
body {
	margin-left: 3px;
	margin-top: 0px;
	margin-right: 3px;
	margin-bottom: 0px;
}

.wSTYLE1 {
	color: #e1e2e3;
	font-size: 12px;
}

.wSTYLE6 {
	color: #000000;
	font-size: 12;
}

.wSTYLE10 {
	color: #000000;
	font-size: 12px;
}

.wSTYLE19 {
	color: #344b50;
	font-size: 12px;
}

.wSTYLE21 {
	font-size: 12px;
	color: #3b6375;
}

.wSTYLE22 {
	font-size: 12px;
	color: #295568;
}

#addClass {
	display: none;
}
#jia{color:white};
-->
</style>
<script>
//全选
function check()
{
   var oin=document.getElementsByName("checkbox2");
   for ( var i = 0; i < oin.length; i++) {
          if(document.getElementById("all").checked==true){
		oin[i].checked=true;
		  }
          if(document.getElementById("all").checked==false){
		oin[i].checked=false;
		  }
          }
}



</script>

<body>
	<table width="100%" border="0" cellpadding="0" cellspacing="0">
		<tr>
			<td width="17" valign="top" background="images/mail_leftbg.gif">
				<img src="images/left-top-right.gif" width="17" height="29" />
			</td>
			<td valign="top" background="images/content-bg.gif">
				<table width="100%" height="31" border="0" cellpadding="0"
					cellspacing="0" class="left_topbg" id="table2">
					<tr>
						<td height="31">
							<div class="titlebt">
								欢迎界面
							</div>
						</td>
					</tr>
				</table>
			</td>
			<td width="16" valign="top" background="images/mail_rightbg.gif">
				<img src="images/nav-right-bg.gif" width="16" height="29" />
			</td>
		</tr>
		<tr>
			<td height="128" valign="middle" background="images/mail_leftbg.gif">&nbsp;
				
			</td>
			<td valign="top" bgcolor="#F7F8F9">


				<!-- 主体内容开始 -->


				<table width="100%" border="0" align="center" cellpadding="0"
					cellspacing="0">
					<tr>
						<td height="30">
							<table width="100%" border="0" cellspacing="0" cellpadding="0">
								<tr>
									<td height="24" bgcolor="#353c44">
										<table width="100%" border="0" cellspacing="0" cellpadding="0">
											<tr>
												<td>
													<table width="100%" border="0" cellspacing="0"
														cellpadding="0">
														<tr>
															<td width="6%" height="19" valign="bottom">
																<div align="center">
																	<img src="images/tb.gif" width="14" height="14" />
																</div>
															</td>
															<td width="94%" valign="bottom">
																<span class="wSTYLE1"> 班级基本信息列表</span>
															</td>
														</tr>
													</table>
												</td>
												<td>
													<div align="right">
														<span class="wSTYLE1">&nbsp;&nbsp;<img
																src="images/add.gif" width="10" height="10" />
																
															<span id="jia" onClick="addClass()">添加</span>&nbsp;														&nbsp;&nbsp; &nbsp;</span><span class="wSTYLE1"> &nbsp;</span>
													</div>
												</td>
											</tr>
										</table>
									</td>
								</tr>
							</table>
						</td>
					</tr>
					<tr>
						<td>
							<table width="100%" border="0" cellpadding="0" cellspacing="1"
								bgcolor="#a8c7ce">
								<tr>
									<td width="3%" height="20" bgcolor="d3eaef" class="wSTYLE10">
										<div align="center"></div>
									</td>
									<td width="9%" height="20" bgcolor="d3eaef" class="wSTYLE6">
										<div align="center">
												<span class="STYLE10">班级名称</span>
										</div>
									</td>
									<td width="9%" height="20" bgcolor="d3eaef" class="wSTYLE6">
										<div align="center">
										
											
												<span class="STYLE10">班级类型</span>
										</div>
									</td>
									<td width="13%" height="20" bgcolor="d3eaef" class="wSTYLE6">
										<div align="center">
											<span class="STYLE10">年级</span>
										</div>
									</td>
									<td width="12%" height="20" bgcolor="d3eaef" class="wSTYLE6">
										<div align="center">
										<span class="STYLE10">专业</span>
										</div>
									</td>
									<td width="14%" height="20" bgcolor="d3eaef" class="wSTYLE6">
										<div align="center">
											<span class="STYLE10">人数</span>
										</div>
									</td>
									<td width="15%" height="20" bgcolor="d3eaef" class="wSTYLE6">
										<div align="center">
											
											<span class="STYLE10">代班教员</span>
										</div>
									</td>
									<td width="25%" height="20" bgcolor="d3eaef" class="wSTYLE6">
										<div align="center">
											<span class="STYLE10">基本操作</span>
										</div>
									</td>
								</tr>
								
																	
									<!--增加班级 -->
									<form method="post" action="cla!save.action" onSubmit="return addClassClick()">
									<!-- 想法是，在循环的 时候 ，同时 循环两种    ，一种显示，另外一种隐藏，当用户点击修改的 时候，显示另外一中，，隐藏当前显示的这一种 -->
									<tr id="addClass">
										<td height="20" bgcolor="#FFFFFF">
											<div align="center"></div>
										</td>
										<td height="20" bgcolor="#FFFFFF" class="wSTYLE6">
											<div align="center">												
											<input name="clas.classname" type="text" id="txtclassName"
													value="" size="10" />
											</div>
										</td>
										<td height="20" bgcolor="#FFFFFF" class="wSTYLE19">
											<div align="center">
											
											<select name="clas.accpClasstype.cid" id="ClassTypeadd">
														<c:forEach var="tt" items="${ljtypelist}">
																<option value="${tt.cid}" selected>
																		${tt.cname}
																	</option>
															</c:forEach>
													</select>
												
											</div>
										</td>
										<td height="20" bgcolor="#FFFFFF" class="wSTYLE19">
											<div align="center">
												<select name="clas.accpGrade.gid" id="addgrade">
													<c:forEach var="gg" items="${glist}">															
															    <option value="${gg.gid}" selected>
																	${gg.gname}
																</option>
															</c:forEach>
												</select>
											</div>
										</td>
										
										<td height="20" bgcolor="#FFFFFF" class="wSTYLE19">
											<div align="center">
												<label>
												
												<select name="clas.accpBiz.bid" id="bizName">
													<c:forEach var="bb" items="${mlist}">
															<option value="${bb.bid}" >
																	${bb.bname}
																</option>
														</c:forEach>
												</select>
												
													
												</label>
											</div>
										</td>
										
										<td height="20" bgcolor="#FFFFFF" class="wSTYLE19">
											<div align="center">
												<input name="clas.cnum" type="text" id="txtclassNum"
													value="" size="10" />
											</div>
										</td>
										
										<td height="20" bgcolor="#FFFFFF" class="wSTYLE19">
											<div align="center">
											
											<select name="clas.accpTeacher.tid" id="addteacher">
													<c:forEach var="t" items="${tlist}">															
															    <option value="${t.tid}" selected>
																	${t.tnickname}
																</option>
															</c:forEach>
												</select>
											
												
											</div>
										</td>
										
										<td height="20" bgcolor="#FFFFFF">
											<div align="center" class="wSTYLE21">
												<input name="" type="submit" value="新增">
												
												<input onClick="quxiao1('addClass')" name="" type="button"
													value="取消">
											</div>
										</td>										
									</tr>
								</form>
								<!-- 新增 班级结束 -->
								
								
								
								<!--循环开始 -->
									<c:forEach var="list" items="${clist}">
									<form action="cla!update.action" method="gets" onSubmit="return  UpClassClick(${list.cid})">
										<tr id="${list.cid}" style="display:none">
											<td height="20" bgcolor="#FFFFFF">
												<div align="center"></div>
											</td>
											<td height="20" bgcolor="#FFFFFF" class="wSTYLE6">
												<div align="center">
												<input name="clas.classname" type="text" id="" value="${list.classname}" size="10" />
													<input  name="clas.cid" type="hidden" id="upcid" value="${list.cid}" size="10" />
												</div>
											</td>
											<td height="20" bgcolor="#FFFFFF" class="wSTYLE19">
												<div align="center">
												
												
												<select name="clas.accpClasstype.cid" id="${list.cid}">
															<c:forEach var="tt" items="${ljtypelist}">
															<c:if test="${list.accpClasstype.cname==tt.cname}">
																<option value="${tt.cid}" selected="selected">
																		${tt.cname}
																</option>
															</c:if>
															<c:if test="${list.accpClasstype.cname!=tt.cname}">
																<option value="${tt.cid}">
																		${tt.cname}
																</option>
															</c:if>
															</c:forEach>
														</select>
													
												</div>
											</td>
											<td height="20" bgcolor="#FFFFFF" class="wSTYLE19">
												<div align="center">
													<select name="clas.accpGrade.gid" id="${list.cid}">
														<c:forEach var="gg" items="${glist}">
														<c:if test="${list.accpGrade.gname==gg.gname}">															
															    <option value="${gg.gid}" selected>
																	${gg.gname}
																</option>
														</c:if>
														<c:if test="${list.accpGrade.gname!=gg.gname}">															
															    <option value="${gg.gid}">
																	${gg.gname}
																</option>
														</c:if>		
															</c:forEach>
													</select>
												</div>
											</td>
											
											<td height="20" bgcolor="#FFFFFF" class="wSTYLE19">
												<div align="center">
													<label>
													
													
													<select name="clas.accpBiz.bid" id="${list.cid}">
														<c:forEach var="bb" items="${mlist}">
														<c:if test="${list.accpBiz.bname==bb.bname}">
															<option value="${bb.bid}" selected="selected">
																	${bb.bname}
															</option>
														</c:if>
														<c:if test="${list.accpBiz.bname!=bb.bname}">
															<option value="${bb.bid}" >
																	${bb.bname}
															</option>
														</c:if>
														
														</c:forEach>
													</select>
													
														
													</label>
												</div>
											</td>
											
											
											<td height="20" bgcolor="#FFFFFF" class="wSTYLE19">
												<div align="center">
													<input name="clas.cnum" type="text" id="${list.cid}"
														value="${list.cnum}" size="10" />
												</div>
											</td>
											
											<td height="20" bgcolor="#FFFFFF" class="wSTYLE19">
												<div align="center">
												
												<select name="clas.accpTeacher.tid" id="${list.cid}">
													<c:forEach var="t" items="${tlist}">
													<c:if test="${list.accpTeacher.tnickname==t.tnickname}">															
															    <option value="${t.tid}" selected>
																	${t.tnickname}
																</option>
													</c:if>
													<c:if test="${list.accpTeacher.tnickname!=t.tnickname}">															
															    <option value="${t.tid}">
																	${t.tnickname}
																</option>
													</c:if>				
															</c:forEach>
												</select>
												
												
													
												</div>
											</td>
											
											<td height="20" bgcolor="#FFFFFF">
												<div align="center" class="wSTYLE21">
													<input name="" type="submit" value="修改">
												
													<input onClick="quxiao(${list.cid})" name="" type="button"
														value="取消">
												</div>
											</td>
										</tr>



											<!---------------------显示输出内容的 ------------------------- -->

										<tr id="${list.cid}1">
											<td height="20" bgcolor="#FFFFFF">
												<div align="center"></div>
											</td>
											
											<td height="20" bgcolor="#FFFFFF" class="wSTYLE6">
												<div align="center">
													${list.classname}
												</div>
											</td>
											<td height="20" bgcolor="#FFFFFF" class="wSTYLE19">
												<div align="center">
														${list.accpClasstype.cname}
														
												</div>
											</td>
											<td height="20" bgcolor="#FFFFFF" class="wSTYLE19">
												<div align="center">
													${list.accpGrade.gname}
													
												</div>
											</td>
											<td height="20" bgcolor="#FFFFFF" class="wSTYLE19">
												<div align="center">
												${list.accpBiz.bname}
												</div>
											</td>
											<td height="20" bgcolor="#FFFFFF" class="wSTYLE19">
												<div align="center">
												${list.cnum}
											
												</div>
											</td>
											<td height="20" bgcolor="#FFFFFF" class="wSTYLE19">
												<div align="center">
													
													<span class="STYLE19">${list.accpTeacher.tnickname }</span>
												</div>
											</td>
											<td height="20" bgcolor="#FFFFFF">
												<div align="center" class="wSTYLE21">
													<a onClick="deleteForm(${list.cid})"
														href="javascript:void(0)">删除</a> |
													<a onClick="selectForm(${list.cid})"
														href="javascript:void(0)">修改</a>
												</div>
											</td>

										</tr>
								  	</form>
								</c:forEach>
                         

							</table>
						</td>
					</tr>
					<tr>
						<td height="30">
							<table width="100%" border="0" cellspacing="0" cellpadding="0">
								<tr>
									<td width="33%">
										<div align="left">
											<span class="wSTYLE22">&nbsp;&nbsp;&nbsp;&nbsp;共有<strong>
													${totalsize}</strong> 条记录，当前第<strong>
													${currpage}</strong> 页，共 <strong>${totalpage}
													</strong> 页</span>
										</div>
									</td>
									<td width="67%">
										<table width="312" border="0" align="right" cellpadding="0"
											cellspacing="0">
											<tr>
											
												<td width="49">
													<div align="center">
													
														<a href="cla.action?currpage=1">首页</a>
													</div>
												</td>
												<td width="49">
													<div align="center">
														<a href="cla.action?currpage=${currpage-1 }">上一页</a>
													</div>
												</td>
												<c:if test="${currpage<totalpage}">
												<td width="49">
												
													<div align="center">
														<a href="cla.action?currpage=${currpage+1 }">下一页</a>
													</div>
												</td>
												<td width="49">
													<div align="center">
														<a href="cla.action?currpage=${totalpage}">尾页</a>
													</div>
												</td>
													</c:if>									
											</tr>
										</table>
									</td>
								</tr>
							</table>
						</td>
					</tr>
				</table>


				<!-- 结束 -->



				&nbsp;
			</td>
			<td background="images/mail_rightbg.gif">&nbsp;
				
			</td>
		</tr>
		<tr>
			<td valign="bottom" background="images/mail_leftbg.gif">
				<img src="images/buttom_left2.gif" width="17" height="17" />
			</td>
			<td background="images/buttom_bgs.gif">
				<img src="images/buttom_bgs.gif" width="17" height="17">
			</td>
			<td valign="bottom" background="images/mail_rightbg.gif">
				<img src="images/buttom_right2.gif" width="16" height="17" />
			</td>
		</tr>
	</table>
</body>